package Message.Game
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import Message.Public.*;

    public class SChatMsg extends Object implements IMessageBase
    {
        public var fromPlayer:SPublicMiniPlayer;
        public var toPlayerName:String;
        public var chatType:int;
        public var content:String;
        public var font:int;
        public var chatDt:Date;
        public var extend:Array;
        public var playerItems:Array;
        public var petInfos:Array;
        public const _type:int = 12008;
        public static var _regist:SChatMsg = new SChatMsg(true);

        public function SChatMsg(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            
        }

        public function getType() : int
        {
            return this._type;
        }

        public function clone() : IMessageBase
        {
            return new SChatMsg();
        }

        public function __write(param1:SerializeStream) : void
        {
            this.fromPlayer.__write(param1);
            param1.writeString(this.toPlayerName);
            param1.writeInt(this.chatType);
            param1.writeString(this.content);
            param1.writeInt(this.font);
            param1.writeDate(this.chatDt);
            SeqStringHelper.write(param1, this.extend);
            SeqPlayerItemHelper.write(param1, this.playerItems);
            SeqSPetInfoHelper.write(param1, this.petInfos);
            
        }

        public function __read(param1:SerializeStream) : void
        {
            this.fromPlayer = new SPublicMiniPlayer();
            this.fromPlayer.__read(param1);
            this.toPlayerName = param1.readString();
            this.chatType = param1.readInt();
            this.content = param1.readString();
            this.font = param1.readInt();
            this.chatDt = param1.readDate();
            this.extend = SeqStringHelper.read(param1);
            this.playerItems = SeqPlayerItemHelper.read(param1);
            this.petInfos = SeqSPetInfoHelper.read(param1);
            
        }

    }
}
